package com.service.impl;

import java.util.HashMap;
import java.util.Map;

import com.bean.Admin;
import com.dao.AdminDao;
import com.dao.impl.AdminDaoImpl;
import com.service.AdminService;

public class AdminServiceImpl implements AdminService {
	AdminDao ad = new AdminDaoImpl();
	@Override
	public Map<String,Object> adminLogin(Admin admin) {
		Map<String,Object> result = new HashMap<String, Object>();
		if(ad.seleAdminByName(admin)==null) {
			result.put("msg","账号错误");
		}
		if(ad.seleAdmin(admin)==null) {
			result.put("msg","密码错误");
		}else {
			result.put("loginAdmin", admin);
		}
		return result;
	}

}
